package library.User;
import library.operation.*;

import java.util.Scanner;
public class NormalUser extends User{
    //定义一个IOperation数组，存放操作对象
    //用户和管理员都有相同的操作，所以定义在父类User中
//    private IOperation[] operations;

    public NormalUser(String name) {
        super(name);
        operations = new IOperation[]{//普通用户的操作通过数组表示出来
          new ExitOperation(),
          new ListOperation(),
          new FindOperation(),
          new BorrowOperation(),
          new ReturnOperation()
        };
    }

    @Override
    public int menu() {
        //打印用户菜单
        System.out.println("==============================");
        System.out.println("欢迎您"+name+"!");
        System.out.println("1：查看书籍列表");
        System.out.println("2：按照名字查找图书");
        System.out.println("3：借阅图书");
        System.out.println("4：归还图书");
        System.out.println("0: 退出系统");
        System.out.println("==============================");
        System.out.println("请输入您的操作");
        Scanner scanner = new Scanner(System.in);
        int choice = scanner.nextInt();
        return choice;

    }
}
